package com.zbf.t1688;

import com.alibaba.fastjson.JSON;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import org.seimicrawler.xpath.JXDocument;
import org.seimicrawler.xpath.JXNode;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * @author: LCG
 * @Date: 2022-03-24 15:42:39
 * @description: 获取 1688的图片地址信息
 **/
public class Get1688ImagesUrl {
    public static void main(String[] args) throws IOException {
        /*String url="https://detail.1688.com/offer/625044295330.html?spm=a312h.2018_new_sem.dh_002.5.c2c6fd9c8v3zvl&cosite=-&tracelog=p4p&clickid=9552157bc493448786bf388006cc44df&sessionid=9bf87311ea893e7e1bb2c0069c197585";

        Connection.Response resp = Jsoup.connect(url)
                .timeout(60000).method(Connection.Method.GET)
                .maxBodySize(0).followRedirects(false).execute();

        String htmlStr = new String(resp.bodyAsBytes());

        Document parse = Jsoup.parse(htmlStr);

        Elements elementsByClass = parse.getElementsByClass("img-list-wrapper");

        System.out.println(parse);*/

        Map<String,Object> map=new HashMap<>();
        map.put("zhangsan","张三");
        map.put("name",null);
        System.out.println(JSON.toJSONString(map));

    }
}
